package com.suse.jd_system_server.auto.service.impl;


import com.suse.jd_system_server.auto.mapper.RoomMapper;
import com.suse.jd_system_server.auto.entity.Room;
import java.util.Map;
import java.util.HashMap;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.suse.jd_system_server.auto.service.RoomService;
/**
 *@作者:lhj
 *Service实现类
 *@Date:2023/10/18
*/
@Service
public class RoomServiceImpl  implements RoomService{


	@Resource
	private RoomMapper roomdao;


	/**
	根据Room_id查询
	*/
	public Object selectByRoom_id(Long room_id){
		return roomdao.selectByRoom_id(room_id);
	}


	/**
	根据Room_id更新
	*/
	public Integer updateByRoom_id(Room demo){
		return roomdao.updateByRoom_id( demo);
	}



	/**
	根据Room_id删除
	*/
	public Integer deleteByRoom_id(Long room_id){
		return roomdao.deleteByRoom_id(room_id);
	}





	/**
	 insert:(插入)
	*/
	public Object insert(Room demo){
		roomdao.insert(demo);
		return demo;
	}



	/**
	 insertOrUpdate(插入或更新(根据主键或唯一索引更新，主键和唯一索引不会改变))
	*/
	public Integer insertOrUpdate(Room demo){
		return roomdao.insertOrUpdate(demo);
	}



	/**
	 insertBath:(批量插入)
	*/
	public Integer insertBatch(List<Room> list){
		return roomdao.insertBatch(list);
	}



	/**
	 insertOrUpdateBatch:(批量插入或更新)
	*/
	public Integer insertOrUpdateBatch(List<Room> list){
		return roomdao.insertOrUpdateBatch(list);
	}



	/**
	 selectList:(根据参数查询集合)
	*/
	public List<Room> selectList(Map<String,Object> param){
		int start = Integer.parseInt(param.get("pageSize").toString()) * (Integer.parseInt(param.get("pageNum").toString()) - 1);
		param.put("pageNum",start);
		return roomdao.selectList(param);
	}



	/**
	 selectCount:(根据集合查询数量)
	*/
	public Long selectCount(Map<String,Object> param){
		return roomdao.selectCount(param);
	}



}